<?php

namespace app\admin\service;

class BaseService
{
    public static $instances = [];

    public static function getInstance()
    {
        $className = static::class;
        if (!isset(self::$instances[$className])) {
            self::$instances[$className] = new $className;
        }
        return self::$instances[$className];
    }
}